package com.vegetable.modules.service.inbound;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.vegetable.common.utils.PageUtils;
import com.vegetable.common.utils.R;
import com.vegetable.modules.entity.inbound.PurchaseDelivery;
import com.vegetable.modules.entity.inbound.po.PurchaseDeliverySequencePO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 入库-采购收货表 服务类
 * </p>
 *
 * @author wangruijie
 * @since 2024-03-09
 */
public interface IPurchaseDeliveryService extends IService<PurchaseDelivery> {

    /**
     * 入库采购收货列表查询
     * @param params
     * @return
     */
    PageUtils queryPage(Map<String, Object> params);

    /**
     * 详情入库采购收货
     * @param id null
     * @return R
     * @author wrj
     * @since 2024/3/7 下午4:35
     */
    R detailPurchaseDelivery(Long id);

    /**
     * 新增入库采购收货
     * @param agentDelivery null
     * @return R
     * @author wrj
     * @since 2024/3/7 下午4:35
     */
    R savePurchaseDelivery(PurchaseDelivery agentDelivery) throws Exception;

    /**
     * 提交入库采购收货
     * @param agentDelivery null
     * @return R
     * @author wrj
     * @since 2024/3/7 下午4:35
     */
    R submitPurchaseDelivery(PurchaseDelivery agentDelivery) throws Exception;

    /**
     * 删除入库采购收货
     * @param id null
     * @return R
     * @author wrj
     * @since 2024/3/7 下午4:35
     */
    R deletePurchaseDelivery(Long id) throws Exception;

    /**
     * 查询（未对账金额 > 0）可收款的采购收货
     * @param customerId null
     * @return List<PurchaseDelivery>
     * @author wrj
     * @since 2024/4/15 下午12:21
     */
    List<PurchaseDelivery> canPaymentList(Long customerId, String startTime, String endTime);


    PurchaseDelivery selectByDeliverId(Long deliverId);

    IPage sequence(PurchaseDeliverySequencePO po);
}
